package com.huateng.springcloud.controller;

import com.huateng.springcloud.po.UserReqVo;
import com.huateng.springcloud.utils.HTJsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.*;

/**
 * Login
 *
 * @author Evan
 * @create 2021/6/13 15:17
 */
@Api(value = "登录注册", tags = {"登录注册相关接口"})
@RestController
@RequestMapping("/login")
public class LoginController {

    @ApiOperation(value = "用户是否存在", notes = "用户是否存在", httpMethod = "GET")
    @GetMapping("/userIsExist")
    public HTJsonResult userIsExist(@RequestParam String userName){
        if (StringUtils.isEmpty(userName)){
            return HTJsonResult.errorMsg("用户名为空");
        }
        return null;
    }

    @ApiOperation(value = "登录", notes = "登录", httpMethod = "POST")
    @PostMapping("/signIn")
    public HTJsonResult signIn(@RequestBody UserReqVo userReqVo){
        return null;
    }

    @ApiOperation(value = "注册", notes = "注册", httpMethod = "POST")
    @PostMapping("/signUp")
    public HTJsonResult signUp(@RequestBody UserReqVo userReqVo){
        return null;
    }

}
